package com.pan.yu.mapper;

import java.util.List;

import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.neo4j.repository.query.Query;
import org.springframework.stereotype.Repository;

import com.pan.yu.entity.Teacher;

@Repository
public interface TeacherNeoMapper extends Neo4jRepository<Teacher, Long>{
	
	@Query("MATCH (n:Teacher),(s:Student) where id(n)={0} and id(s)={2} "
			+ "create (n)-[:school{name:{1}}]->(s) ")
	public void createRelationOut(Long from,String relation,Long to);
	

	@Query("MATCH p=(:Teacher{name:'张三丰'})-[]->()  RETURN p ")
	public List<Teacher> findAll(Long from,String relation,Long to);
}
